<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>Javascript 二维码生成库：QRCode</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/qrcode.js"></script>
</head>
<body>
<div style="margin-left: 200px;">
<input id="text" type="text" value="1"  style="display: none;"  /><br />
<div id="qrcode" style="width:300px; height:300px; margin-top:15px;"></div>
</div>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
	width : 250,
	height : 250
});

function makeCode () {		
	var elText = document.getElementById("text");
	if (!elText.value) {
		alert("请输入内容");
		elText.focus();
		return;
	}

	qrcode.makeCode(elText.value);
}

makeCode();

$("#text").
	on("blur", function () {
		makeCode();
	}).
	on("keydown", function (e) {
		if (e.keyCode == 13) {
			makeCode();
		}
	});
</script>
<script>
    var index;//保存layuiEditID
    $(function () {

        $.ajax({
            url: 'http://localhost:8081/Express/getExpressList',//请求地址
            dataType: 'JSON',//值类型
            data: {
                page:1,
                limit:1,
                id:'',
                consignor:''
            },//往后端发送的值
            success: function (res) {//成功的回调函数
                console.log(res.data)
                $("#text").val(localStorage.getItem("id"))
                // $("#sender").val(res.data[0].sender)
            },
            error: function (data) {//失败的回调函数
                layer.alert("系统出错");
            }
        })
    })
</script>
</body>
</html>